```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模块化系统架构设计</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        }
        .module-card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        .module-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        .code-block {
            background-color: #1e293b;
            color: #e2e8f0;
            border-left: 4px solid #7c3aed;
        }
        .feature-icon {
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            margin-bottom: 1rem;
            color: white;
        }
        .highlight-text {
            position: relative;
            display: inline-block;
        }
        .highlight-text::after {
            content: '';
            position: absolute;
            bottom: 0.1em;
            left: 0;
            width: 100%;
            height: 0.3em;
            background-color: rgba(124, 58, 237, 0.3);
            z-index: -1;
            transition: height 0.3s ease;
        }
        .highlight-text:hover::after {
            height: 0.6em;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold leading-tight mb-4">模块化系统架构设计</h1>
                    <p class="text-xl md:text-2xl opacity-90 mb-8">构建高内聚低耦合的现代化系统</p>
                    <p class="text-lg opacity-80 mb-8">在复杂的项目中，模块化设计能够有效分离关注点，提高代码可维护性和可扩展性。本指南将展示如何通过清晰的模块划分和协作机制来构建健壮的系统。</p>
                    <a href="#modules" class="bg-white text-indigo-700 hover:bg-indigo-50 font-medium py-3 px-6 rounded-lg transition duration-300 inline-flex items-center">
                        探索模块 <i class="fas fa-arrow-down ml-2"></i>
                    </a>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-10 rounded-xl p-4 border border-white border-opacity-20">
                        <div class="mermaid">
                            graph TD
                                A[用户管理] -->|验证| B[订单管理]
                                B -->|检查库存| C[库存管理]
                                B -->|处理支付| D[支付模块]
                                B -->|发送通知| E[通知模块]
                                C -->|获取产品| F[产品管理]
                                G[安全模块] -->|保护| A
                                G -->|保护| B
                                G -->|保护| C
                                G -->|保护| D
                                H[日志监控] -->|记录| A
                                H -->|记录| B
                                H -->|记录| C
                                H -->|记录| D
                                I[缓存模块] -->|加速| A
                                I -->|加速| B
                                I -->|加速| C
                                I -->|加速| F
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Modules Grid -->
    <section id="modules" class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">核心模块概览</h2>
                <p class="text-lg text-slate-600 max-w-2xl mx-auto">我们的系统由多个专业模块组成，每个模块专注于单一职责，通过标准接口进行协作</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- User Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-indigo-500">
                            <i class="fas fa-users text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">用户管理模块</h3>
                        <p class="text-slate-600 mb-4">处理用户注册、登录、权限管理、账户设置等核心功能</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">User</span> <span class="text-gray-300">getUserById(Long userId)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">return</span> userRepository.findById(userId).orElse(<span class="text-purple-300">null</span>);<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-3 py-1 rounded-full">RESTful API</span>
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-3 py-1 rounded-full">Authentication</span>
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-3 py-1 rounded-full">Authorization</span>
                        </div>
                    </div>
                </div>

                <!-- Order Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-amber-500">
                            <i class="fas fa-shopping-cart text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">订单管理模块</h3>
                        <p class="text-slate-600 mb-4">负责订单创建、更新、查询、取消等全生命周期管理</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">void</span> <span class="text-gray-300">createOrder(OrderRequest request)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">if</span> (!inventoryService.checkStock(...)) {<br>
                            &nbsp;&nbsp;&nbsp;&nbsp;<span class="text-purple-300">throw</span> <span class="text-purple-300">new</span> InsufficientStockException();<br>
                            &nbsp;&nbsp;}<br>
                            &nbsp;&nbsp;paymentService.processPayment(order);<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-amber-100 text-amber-800 text-xs px-3 py-1 rounded-full">Transaction</span>
                            <span class="bg-amber-100 text-amber-800 text-xs px-3 py-1 rounded-full">Inventory Check</span>
                            <span class="bg-amber-100 text-amber-800 text-xs px-3 py-1 rounded-full">Payment</span>
                        </div>
                    </div>
                </div>

                <!-- Inventory Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-emerald-500">
                            <i class="fas fa-boxes text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">库存管理模块</h3>
                        <p class="text-slate-600 mb-4">管理商品库存，包括库存查询、更新和预警机制</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">boolean</span> <span class="text-gray-300">checkStock(Long productId, Integer quantity)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">Integer</span> stock = inventoryRepository.getStock(productId);<br>
                            &nbsp;&nbsp;<span class="text-purple-300">return</span> stock >= quantity;<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-emerald-100 text-emerald-800 text-xs px-3 py-1 rounded-full">Stock Control</span>
                            <span class="bg-emerald-100 text-emerald-800 text-xs px-3 py-1 rounded-full">Real-time</span>
                            <span class="bg-emerald-100 text-emerald-800 text-xs px-3 py-1 rounded-full">Synchronization</span>
                        </div>
                    </div>
                </div>

                <!-- Payment Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-blue-500">
                            <i class="fas fa-credit-card text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">支付模块</h3>
                        <p class="text-slate-600 mb-4">处理支付请求、支付确认、退款等金融交易操作</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">PaymentResponse</span> <span class="text-gray-300">processPayment(Order order)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">return</span> paymentGateway.process(order);<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-blue-100 text-blue-800 text-xs px-3 py-1 rounded-full">Third-party</span>
                            <span class="bg-blue-100 text-blue-800 text-xs px-3 py-1 rounded-full">Secure</span>
                            <span class="bg-blue-100 text-blue-800 text-xs px-3 py-1 rounded-full">Transaction</span>
                        </div>
                    </div>
                </div>

                <!-- Notification Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-pink-500">
                            <i class="fas fa-bell text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">通知模块</h3>
                        <p class="text-slate-600 mb-4">发送各类系统通知，包括订单确认、发货通知等</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">void</span> <span class="text-gray-300">sendOrderConfirmation(Long userId, String orderNumber)</span> {<br>
                            &nbsp;&nbsp;<span class="text-blue-300">User</span> user = userService.getUserById(userId);<br>
                            &nbsp;&nbsp;emailService.sendEmail(user.getEmail(), <span class="text-green-300">"Order Confirmation"</span>, ...);<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-pink-100 text-pink-800 text-xs px-3 py-1 rounded-full">Email</span>
                            <span class="bg-pink-100 text-pink-800 text-xs px-3 py-1 rounded-full">SMS</span>
                            <span class="bg-pink-100 text-pink-800 text-xs px-3 py-1 rounded-full">Push</span>
                        </div>
                    </div>
                </div>

                <!-- Product Module -->
                <div class="module-card bg-white rounded-xl overflow-hidden border border-gray-100">
                    <div class="p-6">
                        <div class="feature-icon bg-purple-500">
                            <i class="fas fa-cube text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold mb-3">产品管理模块</h3>
                        <p class="text-slate-600 mb-4">管理系统中的产品信息，包括创建、更新、查询和删除</p>
                        <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">public</span> <span class="text-blue-300">Product</span> <span class="text-gray-300">getProductById(Long productId)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">return</span> productRepository.findById(productId).orElse(<span class="text-purple-300">null</span>);<br>
                            }
                        </div>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-purple-100 text-purple-800 text-xs px-3 py-1 rounded-full">CRUD</span>
                            <span class="bg-purple-100 text-purple-800 text-xs px-3 py-1 rounded-full">Catalog</span>
                            <span class="bg-purple-100 text-purple-800 text-xs px-3 py-1 rounded-full">Metadata</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Detailed Explanation -->
    <section class="py-16 px-4 bg-slate-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">模块协作机制详解</h2>
                <p class="text-lg text-slate-600 max-w-3xl mx-auto">了解各模块如何通过清晰的接口和规范进行交互，构建完整的业务流程</p>
            </div>

            <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                <!-- Left Column -->
                <div>
                    <div class="bg-white rounded-xl p-6 mb-6 shadow-sm">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-exchange-alt text-indigo-500 mr-3"></i>
                            <span class="highlight-text">内部调用机制</span>
                        </h3>
                        <ul class="space-y-4">
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-link text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">RESTful API</p>
                                    <p class="text-slate-600 text-sm">模块间通过定义良好的RESTful接口进行通信，使用HTTP标准方法</p>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-code-branch text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">RPC调用</p>
                                    <p class="text-slate-600 text-sm">高性能场景下使用RPC框架进行直接方法调用，减少网络开销</p>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-database text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">共享数据库</p>
                                    <p class="text-slate-600 text-sm">部分模块通过共享数据库表进行数据交换，需谨慎设计以避免强耦合</p>
                                </div>
                            </li>
                        </ul>
                    </div>

                    <div class="bg-white rounded-xl p-6 shadow-sm">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-globe text-indigo-500 mr-3"></i>
                            <span class="highlight-text">外部调用机制</span>
                        </h3>
                        <ul class="space-y-4">
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-server text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">API网关</p>
                                    <p class="text-slate-600 text-sm">通过统一的API网关暴露系统功能，实现认证、限流和监控</p>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-plug text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">第三方集成</p>
                                    <p class="text-slate-600 text-sm">与支付网关、物流系统等第三方服务通过标准协议集成</p>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-100 text-indigo-800 flex items-center justify-center mr-3 mt-0.5">
                                    <i class="fas fa-cloud text-xs"></i>
                                </div>
                                <div>
                                    <p class="font-medium">Webhook</p>
                                    <p class="text-slate-600 text-sm">提供Webhook机制让外部系统订阅系统事件通知</p>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- Right Column -->
                <div>
                    <div class="bg-white rounded-xl p-6 shadow-sm h-full">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-project-diagram text-indigo-500 mr-3"></i>
                            <span class="highlight-text">典型业务流程示例</span>
                        </h3>
                        <div class="space-y-6">
                            <div>
                                <h4 class="font-medium text-lg mb-2 text-indigo-600">1. 订单创建流程</h4>
                                <ol class="list-decimal list-inside space-y-2 text-sm text-slate-700">
                                    <li>前端调用订单管理模块API发起订单创建</li>
                                    <li>订单模块调用用户模块验证用户身份和权限</li>
                                    <li>订单模块调用库存模块检查商品库存</li>
                                    <li>库存充足则锁定库存，否则返回错误</li>
                                    <li>订单模块调用支付模块处理支付</li>
                                    <li>支付成功后，订单模块调用通知模块发送确认邮件</li>
                                    <li>订单模块记录订单创建日志到日志模块</li>
                                </ol>
                            </div>
                            <div>
                                <h4 class="font-medium text-lg mb-2 text-indigo-600">2. 库存预警流程</h4>
                                <ol class="list-decimal list-inside space-y-2 text-sm text-slate-700">
                                    <li>库存模块定期检查库存水平</li>
                                    <li>当库存低于阈值时，调用通知模块发送预警通知</li>
                                    <li>同时调用报告模块生成库存预警报告</li>
                                    <li>报告模块从产品模块获取产品详细信息</li>
                                    <li>将生成的报告存储并通过API提供给管理后台</li>
                                </ol>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Additional Modules -->
    <section class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold mb-12 text-center">支持性模块</h2>
            
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <!-- Logging Module -->
                <div class="bg-slate-50 rounded-xl p-6 border border-slate-200">
                    <div class="flex items-center mb-4">
                        <div class="flex-shrink-0 h-12 w-12 rounded-lg bg-slate-800 text-white flex items-center justify-center mr-4">
                            <i class="fas fa-clipboard-list"></i>
                        </div>
                        <h3 class="text-xl font-bold">日志和监控模块</h3>
                    </div>
                    <p class="text-slate-600 mb-4">收集系统日志、监控系统性能、生成告警，保障系统稳定运行</p>
                    <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                        <span class="text-purple-300">public</span> <span class="text-blue-300">void</span> <span class="text-gray-300">logOrderCreation(Order order)</span> {<br>
                        &nbsp;&nbsp;logger.info(<span class="text-green-300">"Order created: {}"</span>, order);<br>
                        }
                    </div>
                </div>
                
                <!-- Report Module -->
                <div class="bg-slate-50 rounded-xl p-6 border border-slate-200">
                    <div class="flex items-center mb-4">
                        <div class="flex-shrink-0 h-12 w-12 rounded-lg bg-blue-600 text-white flex items-center justify-center mr-4">
                            <i class="fas fa-chart-bar"></i>
                        </div>
                        <h3 class="text-xl font-bold">报告模块</h3>
                    </div>
                    <p class="text-slate-600 mb-4">生成各类业务报告，提供数据分析和决策支持</p>
                    <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                        <span class="text-purple-300">public</span> <span class="text-blue-300">SalesReport</span> <span class="text-gray-300">generateSalesReport(Date start, Date end)</span> {<br>
                        &nbsp;&nbsp;<span class="text-blue-300">List</span>&lt;Order&gt; orders = orderRepository.findByDateRange(start, end);<br>
                        &nbsp;&nbsp;<span class="text-purple-300">return</span> reportGenerator.createSalesReport(orders);<br>
                        }
                    </div>
                </div>
                
                <!-- Cache Module -->
                <div class="bg-slate-50 rounded-xl p-6 border border-slate-200">
                    <div class="flex items-center mb-4">
                        <div class="flex-shrink-0 h-12 w-12 rounded-lg bg-green-600 text-white flex items-center justify-center mr-4">
                            <i class="fas fa-bolt"></i>
                        </div>
                        <h3 class="text-xl font-bold">缓存模块</h3>
                    </div>
                    <p class="text-slate-600 mb-4">提供高性能缓存服务，减轻数据库压力，提升系统响应速度</p>
                    <div class="code-block rounded-lg p-4 mb-4 font-mono text-sm overflow-x-auto">
                        <span class="text-purple-300">public</span> <span class="text-blue-300">Product</span> <span class="text-gray-300">getCachedProduct(Long productId)</span> {<br>
                        &nbsp;&nbsp;<span class="text-blue-300">Product</span> product = cache.get(productId);<br>
                        &nbsp;&nbsp;<span class="text-purple-300">if</span> (product == <span class="text-purple-300">null</span>) {<br>
                        &nbsp;&nbsp;&nbsp;&nbsp;product = productRepository.findById(productId).orElse(<span class="text-purple-300">null</span>);<br>
                        &nbsp;&nbsp;&nbsp;&nbsp;cache.put(productId, product);<br>
                        &nbsp;&nbsp;}<br>
                        &nbsp;&nbsp;<span class="text-purple-300">return</span> product;<br>
                        }
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Security Section -->
    <section class="py-16 px-4 bg-indigo-900 text-white">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h2 class="text-3xl md:text-4xl font-bold mb-6">安全模块</h2>
                    <p class="text-lg opacity-90 mb-6">作为系统的守护者，安全模块为其他所有模块提供全面的安全保护</p>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-600 text-white flex items-center justify-center mr-3">
                                <i class="fas fa-shield-alt text-xs"></i>
                            </div>
                            <div>
                                <p class="font-medium">认证和授权</p>
                                <p class="opacity-80 text-sm">基于角色的访问控制(RBAC)确保用户只能访问授权资源</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-600 text-white flex items-center justify-center mr-3">
                                <i class="fas fa-lock text-xs"></i>
                            </div>
                            <div>
                                <p class="font-medium">数据加密</p>
                                <p class="opacity-80 text-sm">敏感数据在传输和存储时都进行强加密保护</p>
                            </div>
                        </li>
                        <li class="flex items-start">
                            <div class="flex-shrink-0 h-6 w-6 rounded-full bg-indigo-600 text-white flex items-center justify-center mr-3">
                                <i class="fas fa-user-secret text-xs"></i>
                            </div>
                            <div>
                                <p class="font-medium">安全审计</p>
                                <p class="opacity-80 text-sm">记录所有敏感操作，便于追踪和审计</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="md:w-1/2 md:pl-10">
                    <div class="bg-indigo-800 rounded-xl p-6">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <i class="fas fa-code mr-3"></i>
                            安全验证示例
                        </h3>
                        <div class="code-block rounded-lg p-4 font-mono text-sm overflow-x-auto">
                            <span class="text-purple-300">@PreAuthorize</span>(<span class="text-green-300">"hasRole('ADMIN')"</span>)<br>
                            <span class="text-purple-300">public</span> <span class="text-blue-300">void</span> <span class="text-gray-300">deleteUser(Long userId)</span> {<br>
                            &nbsp;&nbsp;<span class="text-gray-500">// 只有管理员可以删除用户</span><br>
                            &nbsp;&nbsp;userRepository.deleteById(userId);<br>
                            }<br><br>
                            <span class="text-purple-300">public</span> <span class="text-blue-300">boolean</span> <span class="text-gray-300">hasPermission(User user, String permission)</span> {<br>
                            &nbsp;&nbsp;<span class="text-purple-300">return</span> userPermissionsService.hasPermission(user.getId(), permission);<br>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'dark',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```